using System;
using System.ComponentModel;



namespace Camalon.Drawing
{
	public enum ShapeCombineMode
	{
		Complement,
		Exclude,
		Intersect,
		Union,
		Xor
	}



	[Serializable]
	[TypeConverter(typeof(ShapeCombineConverter))]
	public struct ShapeCombine
	{

		private Shape			_shape;
		private ShapeCombineMode		_mode;

		public ShapeCombine(Shape shape, ShapeCombineMode mode)
		{
			_mode		= mode;
			_shape		= shape;
		}


		[Browsable(false)]
		public bool Equals(ShapeCombine join)
		{
			return	_shape == join.Shape && _mode == join.Mode ;
		}

		[Browsable(false)]
		public bool IsEmpty
		{
			get{ return _shape == null;}
		}


		public static ShapeCombine Empty
		{
			get{ return new ShapeCombine(null,ShapeCombineMode.Union);}
		}


		[DefaultValue(null)]
		[RefreshProperties( RefreshProperties.All)]
		[ImmutableObject(true)]
		public Shape Shape
		{
			get{ return _shape;}
			set
			{ 
				if( _shape == value) return;
				_shape = value;

			}

		}


		[DefaultValue(ShapeCombineMode.Union)]
		[RefreshProperties( RefreshProperties.All)]
		public ShapeCombineMode Mode
		{
			get
			{ 
				return _mode;
			}
			set
			{ 
				if( _mode == value) return;
				_mode =value;

			}
		}


	}


}
